// import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../components/Layout'
import Index from '../views/Index'
import Category from '../views/Category'
import Tag from '../views/Tag'
import About from '../views/About'
import Post from '../views/Post'

Vue.use(Router)

export default new Router({
  linkActiveClass: 'current-menu-item',
  routes: [
    {
      path: '/',
      component: Layout,
      redirect: 'index',
      children: [
        {
          path: 'index',
          name: 'Index',
          component: Index
        }, {
          path: 'category/:categoryId',
          name: 'Category',
          component: Category,
          props: true
        }, {
          path: 'tag/:tagName',
          name: 'Tag',
          component: Tag,
          props: true
        },
        {
          path: 'about',
          name: 'About',
          component: About,
        },
        {
          path: 'post/:postId',
          name: 'Post',
          component: Post,
          props: true
        }
      ]
    }
  ]
})
